package #PACKAGE#;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

// import #PACKAGE#.BussnessServiceImpl;

import #DAOPKG#.#CLASSNAME#Dao;
import #MODEL_PKG#.#CLASSNAME#;
import #MODEL_PKG#.Pager;
import #MODEL_PKG#.QueryCondition;
import #IMPORTSERVICE#;

@Service("#LOWER_CASENAME#Service") @Scope("prototype")
public class #CLASSNAME#ServiceImpl implements #CLASSNAME#Service {
	@Autowired
	private #CLASSNAME#Dao #LOWER_CASENAME#Dao;
	
	public Pager<#CLASSNAME#> findAll(String ascProperty,boolean isAsc,int start,int limit){
        return #LOWER_CASENAME#Dao.findAll(#CLASSNAME#.class, ascProperty, isAsc, start, limit);
	}
	
	public Pager<#CLASSNAME#> findAll(String ascProperty,boolean isAsc,int start,int limit,List<QueryCondition> entities){
        return #LOWER_CASENAME#Dao.findAll(#CLASSNAME#.class, ascProperty, isAsc, start, limit,entities);
	}
	
	public void saveOrUpdate(#CLASSNAME# model){
		#LOWER_CASENAME#Dao.saveOrUpdate(model);
	}
	
	public void updateAttr(String attr,Object val,Long id){
		#LOWER_CASENAME#Dao.updateAttr(#CLASSNAME#.class,attr,val,id);
	}
	
	public void delete(Long id){
		#LOWER_CASENAME#Dao.delete(#CLASSNAME#.class,id);
	}
	
	public void attrDeletes(String attr,Object val){
		#LOWER_CASENAME#Dao.attrDeletes(#CLASSNAME#.class,val);
	}
	
	public void deleteBulk(List<#CLASSNAME#> list){
		#LOWER_CASENAME#Dao.deleteBulk(list);
	}
	
	public #CLASSNAME# get(Long id){
		return #LOWER_CASENAME#Dao.get(#CLASSNAME#.class,id);
	}
}
